/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Utilidades;

import java.awt.Color;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.JTextField;

/**
 *
 * @author humberto
 */
public class resaltador implements KeyListener{


        JTextField campo;
        public resaltador (JTextField campo)
        {
            this.campo = campo;
        }

            public void keyTyped(KeyEvent e) {
                if (utils.verificarString(campo.getText()))
                    campo.setForeground(Color.RED);
                else
                    campo.setForeground(Color.GREEN);
            }

            public void keyPressed(KeyEvent e) {
                if (utils.verificarString(campo.getText()))
                    campo.setForeground(Color.RED);
                else
                    campo.setForeground(Color.GREEN);
            }

            public void keyReleased(KeyEvent e) {
                if (utils.verificarString(campo.getText()))
                    campo.setForeground(Color.RED);
                else
                    campo.setForeground(Color.GREEN);
            }



}
